<template>
  <div id="components-affix-demo-target" ref="container" class="scrollable-container">
    <div class="background">
      <CloudAffix :target="() => this.$refs.container">
        <CloudButton type="primary">
          Fixed at the top of container
        </CloudButton>
      </CloudAffix>
    </div>
  </div>
</template>
<script>
export default {
  title: '2.滚动容器',
};
</script>
<style>
#components-affix-demo-target.scrollable-container {
  height: 100px;
  overflow-y: scroll;
}
#components-affix-demo-target .background {
  padding-top: 60px;
  height: 300px;
  background-image: url('https://zos.alipayobjects.com/rmsportal/RmjwQiJorKyobvI.jpg');
}
</style>